class Solution {
public:
    int findValueOfPartition(vector<int>& nums) {
        int mi = 1e9;
        sort(nums.begin(), nums.end());
        int n = nums.size();
        for (int i = 1; i < n; i++) {
            mi = min(mi, abs(nums[i - 1] - nums[i]));
        }
        return mi;
    }
};